Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add submit_on_enter prop to Textarea #1036

Merged
merged 2 commits into from
May 14, 2024
Merged

Add submit_on_enter prop to Textarea #1036

merged 2 commits into from
May 14, 2024

Conversation

tcbegley
Copy link
Collaborator

The Textarea component currently increments n_submit when the enter key is pressed, and the user must press shift + enter in order to create a newline.

This isn't the default behaviour of a <textarea> component. However, since it seems to be common desired behaviour in a chat style application, we shouldn't change the default behaviour.

Instead this PR adds a new prop submit_on_enter, which when set to False, creates a new line in the Textarea and does not increment n_submit.

See #1035

@tcbegley tcbegley merged commit 38fe183 into main May 14, 2024
14 checks passed
@tcbegley tcbegley deleted the textarea-enter-submit branch May 14, 2024 20:42
@tcbegley tcbegley mentioned this pull request May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant